
<?php
$i = 0;


?>
<div class="container">
    <div class="span-4">
        <div id="content">
            <h2>DEPOSIT TICKET</h2>
            <p>Date:<?= $date ?></p>
            <br/>
            <br/>
            <p>Signature:</p>
            <center>
                <strong>KENTUCKY HOME BANK</strong>
                <strong>BARDSTOWN KY 4004</strong>
            </center>
        </div>
    </div>
    <div class="span-13" >
        <div id="content">
            <?php
            $table = new CI_Table();
            
            $tableData = $table->make_columns(array(
                'Cash', '', '', $i>=count($data)?0:$data[$i++]->amount, '', $i>=count($data)?0:$data[$i++]->amount,
                '', $i>=count($data)?0:$data[$i++]->amount, '', $i>=count($data)?0:$data[$i++]->amount, '', $i>=count($data)?0:$data[$i++]->amount,
                '', $i>=count($data)?0:$data[$i++]->amount, '', $i>=count($data)?0:$data[$i++]->amount, '', $i>=count($data)?0:$data[$i++]->amount,
                '', $i>=count($data)?0:$data[$i++]->amount, '', $i>=count($data)?0:$data[$i++]->amount, '', $i>=count($data)?0:$data[$i++]->amount,
                '', $i>=count($data)?0:$data[$i++]->amount, '', $i>=count($data)?0:$data[$i++]->amount, '', $i>=count($data)?0:$data[$i++]->amount,
                '', $i>=count($data)?0:$data[$i++]->amount, '', $i>=count($data)?0:$data[$i++]->amount, 'Sub Total', $total,
                '', $i>=count($data)?0:$data[$i++]->amount, '', $i>=count($data)?0:$data[$i++]->amount, 'Less <br/> Cash <br/> Receiver', ''
                    ), 6);
            echo $table->generate($tableData);
            ?>
          
            <?php
            $table->clear();
            $table->add_row(array(
                $depno, 'Total <br/>Number <br/>of <br/>Deposited Items',count($data), $total
            ));
            echo $table->generate();
            ?>

        </div>
    </div>
    <div class="clear"></div>
    <div class="span-17">
    <center><h3>Deposit summary</h3></center>
    <p>Summary of Deposit to ... on <?php echo $date ?></p>
    <?php
    $table->clear();
    $table->set_heading('Chk No', 'Payment Method', 'Rcd From', 'Memo', 'Amount');
    foreach ($data as $item) {
        /* @var $recled RecLed */

        $cusname = $item->customer->firstname . ' ' . $item->customer->lastname;
        if (strlen($cusname) > 40) {
            $cusname = substr($cusname, 0, 17) . '...';
        }
        if (strlen($memo) > 20) {
            $memo = substr($memo, 0, 17) . '...';
        }
        $table->add_row(array(
            $item->ckno,
            PaymentMethods::getDesc($item->paymethod),
            $cusname,
            $memo,
            $item->amount
        ));
    }
    $table->add_row('', '', '', 'Deposit Subtotal', $total);
    $table->add_row('', '', '', 'Less Cash Back', 0);
    $table->add_row('', '', '', 'Deposit Total', $total);
    echo $table->generate();
    ?>
    </div>
</div>
